package com.ydl.util;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.ydl.entry.pojo.User;


import java.util.Map;

public class ExcelListener extends AnalysisEventListener<User> {
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("解析表头信息");
        System.out.println(headMap);
    }

    @Override
    public void onException(Exception exception, AnalysisContext context) {
        System.out.println("Error Message : " + exception);
    }

    @Override
    public void invoke(User user, AnalysisContext analysisContext) {
        System.out.println(user);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("解析完毕");
    }

    @Override
    public boolean hasNext(AnalysisContext context) {
        return super.hasNext(context);
    }
}
